<?php
$loader->requireOnce('includes/RadConnector/RadComponentConnector.class.php');
class RadQueueConnector extends RadComponentConnector {
    private $logger;
    const RAD_QUEUE_PROCESSOR   =   "RadQueue/RadQueueProcessor";
    const CONTROLLER_RAD_QUEUE  =   'C_RadQueue';
    function __construct(){
        $this->logger = LoggerManager::getLogger('includes.RadConnector.RadQueueConnector');
        parent::__construct();
    }

    public function addAssignmentTicketToWaitingQueue($data) {
    	$this->logger->info('Start function addAssignmentTicketToWaitingQueue');
        $objProcessor   =   $this->hisLoader->getObj(self::RAD_QUEUE_PROCESSOR); // Note: throw HISFileLoaderException if loading fail
        $this->logger->info('Finish function addAssignmentTicketToWaitingQueue');
        return $objProcessor->addTicketToWaitingQueue($data);
    }

    public function finishAssignment($radTicketId) {
        $objController  =   $this->hisLoader->getObj(self::CONTROLLER_RAD_QUEUE); // Note: throw HISFileLoaderException if loading fail
        $result         =   $objController->actionFinishQueueItemAjax($radTicketId);
        return json_decode($result, true);
    }
}
?>